package com.hopu.petshop.controller.old;//package com.hopu.petshop.controller;
//
//
//import com.hopu.petshop.service.PetService;
//
//import javax.servlet.ServletException;
//import javax.servlet.annotation.WebServlet;
//import javax.servlet.http.HttpServlet;
//import javax.servlet.http.HttpServletRequest;
//import javax.servlet.http.HttpServletResponse;
//import java.io.IOException;
//import java.sql.SQLException;
//
///**
// * 删除宠物的Servlet
// */
//@WebServlet("/removePet.do")
//public class RemovePetServlet extends HttpServlet {
//
//    //用spring创建service对象
//    private PetService petService = SpringConfig.getContext().getBean(PetService.class);
//
//    @Override
//    protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
//        //获得id
//        String id = req.getParameter("id");
//        //删除宠物
//        try {
//            petService.removePetById(Integer.valueOf(id));
//            //跳转查询宠物
//            resp.sendRedirect("/findPetsPage.do");
//        } catch (SQLException e) {
//            e.printStackTrace();
//        }
//    }
//}
